﻿// <copyright file="DuplicateModemIdError.cs" company="Hallvard Korsgaard">
//  Microsoft Public License (Ms-PL). See license details here: http://enoceannet.codeplex.com/license
// </copyright>
// <author>Hallvard Korsgaard</author> 

namespace EnOcean.Message.Error
{
  using System;

  /// <summary>
  /// When the TCM receives an original (not repeated) MDA telegram with the same modem ID as its own, it sends this 
  /// message to inform that at least 2 TCMs have the same modem ID. This is not necessarily a 
  /// problem and may even be intended. On the other hand it may also indicate that there is another installation/building in the 
  /// vicinity where the same modem ID is in use. 
  /// </summary>
  [Serializable]
  public class DuplicateModemIdError : Error
  {
    /// <summary>
    /// Creates the byte format of the message.
    /// </summary>
    /// <param name="message">A byte array of length 14 to hold the message contents.</param>
    protected internal override void CreateMessage(byte[] message)
    {
      base.CreateMessage(message);
      message[3] = (byte)MessageType.DuplicateModemIdError;
    }
  }
}
